#include "SMPPQueryBroadcastSM.hpp"

using namespace smpp::pdu;

QueryBroadcastSM::QueryBroadcastSM(const Header &nHeader,
const CoctetString &nMessageId,
const quint8 nSourceAddrTON,
const quint8 nSourceAddrNPI,
const CoctetString &nSourceAddr,
const QueryBroadcastRequestOptionalTLVs &nQueryBroadcastRequestOptionalTLVs):
Header(nHeader),
_MessageId(nMessageId),
_SourceAddrTON(nSourceAddrTON),
_SourceAddrNPI(nSourceAddrNPI),
_SourceAddr(nSourceAddr),
QueryBroadcastRequestOptionalTLVs(nQueryBroadcastRequestOptionalTLVs){}

QueryBroadcastSM::QueryBroadcastSM(
const QueryBroadcastSM &nQueryBroadcastSM):
Header(nQueryBroadcastSM),
_MessageId(nQueryBroadcastSM.getMessageId()),
_SourceAddrTON(nQueryBroadcastSM.getSourceAddrTON()),
_SourceAddrNPI(nQueryBroadcastSM.getSourceAddrNPI()),
_SourceAddr(nQueryBroadcastSM.getSourceAddr()),
QueryBroadcastRequestOptionalTLVs(nQueryBroadcastSM){}

void QueryBroadcastSM::setMessageId(const CoctetString &nMessageId){
	_MessageId = nMessageId;
}

const CoctetString &QueryBroadcastSM::getMessageId() const{
	return _MessageId;
}

void QueryBroadcastSM::setSourceAddrTON(const quint8 nSourceAddrTON){
	_SourceAddrTON = nSourceAddrTON;
}

const quint8 QueryBroadcastSM::getSourceAddrTON() const{
	return _SourceAddrTON;
}

void QueryBroadcastSM::setSourceAddrNPI(const quint8 nSourceAddrNPI){
	_SourceAddrNPI = nSourceAddrNPI;
}

const quint8 QueryBroadcastSM::getSourceAddrNPI() const{
	return _SourceAddrNPI;
}

void QueryBroadcastSM::setSourceAddr(const CoctetString &nSourceAddr){
	_SourceAddr = nSourceAddr;
}

const CoctetString &QueryBroadcastSM::getSourceAddr() const{
	return _SourceAddr;
}

void QueryBroadcastSM::calcCommandLength(){
	_CommandLength = 18 + _MessageId.size() + _SourceAddr.size() + 
		QueryBroadcastRequestOptionalTLVs::getLength();
}
